package com.lswms.controller;

import com.lswms.common.exception.ErrorCode;
import com.lswms.common.exception.RenException;
import com.lswms.common.utils.ZqDateUtil;
import com.lswms.dto.vo.resp.ForecastLuckResp;

import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.Calendar;
import java.util.Date;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;

import oracle.sql.BINARY_DOUBLE;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

public class Test {

	public static void main(String[] args) throws UnsupportedEncodingException {
		/*Date sign = ZqDateUtil.getDatehms("2020-05-25 05:00:00");
		Long t1 = sign.getTime() - ZqDateUtil.getNow().getTime();*/

		/*String str = "{\"data\": {       \"app_id\": \"1453315224847733\",       \"type\": \"USER\",       \"application\": \"\\u6311\\u6218\\u8005\\u4e16\\u754c\",       \"data_access_expires_at\": 1598592751,       \"expires_at\": 1590822000,       \"is_valid\": true,       \"scopes\": [          \"public_profile\"       ],       \"user_id\": \"129916328705475\"    } }";
		
		
		JSONObject retJson = JSONObject.parseObject(str);
        Object resp = retJson.get("error");
        if(resp != null){
        	System.out.println("error");
        }
    	JSONObject retJson1 = (JSONObject)retJson.get("data");
        if(retJson1 == null){
        	System.out.println("error111");
        }

    	Boolean is_valid = retJson1.getBoolean("is_valid");
    	String app_id = retJson1.getString("app_id");
    	String user_id = retJson1.getString("user_id");
    	System.out.println(is_valid);
    	System.out.println(app_id);
    	System.out.println(user_id);*/
		/*for(int i = 0;i<10;i++){
			int number = new Random().nextInt(3);
			System.out.println(number);
		}*/
		/*String luck = "0,1,2";
		String[] luckA = luck.split(",");
		
		System.out.println(luckA[new Random().nextInt(luckA.length)]);
		Random random=new Random();
		int num= (int)(random.nextDouble()*(99999-10000 + 1))+ 10000;
		String replace = num+"";
		String regex = "(.{1})";
	    replace = replace.replaceAll(regex, "$1 ");
		System.out.println(replace);
		*/
		
		/*for(int i = 0;i<=10;i++){
			Date now = ZqDateUtil.addDate(ZqDateUtil.getNow(),i, Calendar.DAY_OF_MONTH);
			String week = ZqDateUtil.dateToWeek(ZqDateUtil.yyyy_MM_dd(now));
			if(week.equals("星期二") || week.equals("星期四") || week.equals("星期日")){
				System.out.println(ZqDateUtil.yyyy_MM_dd(now)+"---"+week);
			}
		}*/
		
		/*String a = "1,2";
		for(int i = 0;i<a.split(",").length;i++){
			System.out.println(a.split(",")[i]);
		}
		
		System.out.println(new BigDecimal(-1));*/
		
		/*Calendar calendar = Calendar.getInstance();
		int curHour24 = calendar.get(calendar.HOUR_OF_DAY);
		System.out.println(curHour24);
		
		int start = 80;
        int end = 90;
        for(int i = 0;i<100;i++){
	        int a = ThreadLocalRandom.current().nextInt(start, end);
	        System.out.println(a);
        }*/
		/*for(int i = 0;i<=6;i++){
			String date = ZqDateUtil.yyyy_MM_dd(ZqDateUtil.addDate(ZqDateUtil.getNow(), -i, Calendar.DAY_OF_MONTH));
			System.out.println(date);
		}*/
		/*for(int i = 0;i<10;i++){
			int num = (int) (Math.random() * 2);
			System.out.println(num);
			System.out.println((int)((Math.random()*9+1)*1000000));
		}*/
        /*int a = ThreadLocalRandom.current().nextInt(0, 2);
        System.out.println(a);
        System.out.println(ZqDateUtil.yyyyMMddHHmmssSSSHl());
		Calendar calendar = Calendar.getInstance();
		int curHour24 = calendar.get(calendar.SECOND);
		System.out.println(curHour24);
		if(curHour24%5 == 0){
			System.out.println(curHour24);
		}*/
		
		
		System.out.println(5%1);
		System.out.println(3%1);
	}
	
}
